package com.bomb.voice.net;

import com.orhanobut.logger.Logger;

import java.net.SocketTimeoutException;
import java.net.UnknownHostException;

import rx.Subscriber;

public class HttpSubscriber<T> extends Subscriber<T> {
    @Override
    public void onCompleted() {


    }

    @Override
    public void onError(Throwable throwable) {
        Logger.e("异常日志:发生了 错误 HttpSubscriber");
        Logger.e(throwable.getMessage());
        throwable.printStackTrace();
        try {
            throw throwable;

        } catch (SocketTimeoutException Exception) {
//            Toast.makeText(MyApp.get(), "请检查网络连接,请求超时!", Toast.LENGTH_SHORT).show();
        }catch (UnknownHostException exception) {
//            Toast.makeText(MyApp.get(), "请求服务器失败，请稍后再试", Toast.LENGTH_SHORT).show();
        } catch (Exception exception) {
//            CrashReport.postCatchedException(new Throwable("待处理: 其他未处理异常 " + exception));// bugly会将这个throwable上报
//            Toast.makeText(MyApp.get(), exception.getLocalizedMessage(), Toast.LENGTH_SHORT).show();

        } catch (Throwable throwable1) {
//            CrashReport.postCatchedException(new Throwable("待处理: 其他未处理Throwable " + throwable1));// bugly会将这个throwable上报
//            Toast.makeText(MyApp.get(), throwable1.getLocalizedMessage(), Toast.LENGTH_SHORT).show();
        }
    }

    @Override
    public void onNext(T t) {

    }
}